﻿package 
{
    import Chat.*;
    import com.assist.view.interfaces.*;
    import com.lang.client_resources.chat.*;
    import com.protocols.*;
    import com.riaidea.text.*;
    import flash.display.*;
    import flash.events.*;
    import flash.filters.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.ui.*;
    import flash.utils.*;

    public class Chat extends MovieClip implements IChat
    {
        public var _PostBox:MovieClip;
        public var _LaoBa:MovieClip;
        public var _PunishmentPostBox:MovieClip;
        public var _ChatBox:MovieClip;
        private var _systemChatInfo:String;
        private var _onTextLink:Function;
        private var _onOpenGm:Function;
        private var _tip:ITip;
        private var _allType:int = 99;
        private var _chatShow:int;
        private var _worldList:Array;
        private var _activityList:Array;
        private var _factionList:Array;
        private var _allList:Array;
        private var _timer:Timer;
        private var _btnMcTimer:Timer;
        private var _btnTimerNum:int = 0;
        private var _btnList:Array;
        private var _gotoMc:MovieClip;
        private var _showChatScale:int = 1;
        private var _showSize:int = 130;
        private var _chatMc:MovieClip;
        private var _chatText:RichTextField;
        private var _textFormat:TextFormat;
        private var _sendDataPlayerId:int = 0;
        private var _sendText:RichTextField;
        private var _sendTextFormat:TextFormat;
        private var _scrollbar:Scrollbar;
        private var _playerId:int = 0;
        private var _nickName:String = "";
        private var _removeSuffix:Function;
        private var _onSendChat:Function;
        private var _timerNum:int = 0;
        private var _sendChatList:Array;
        private var _sendChatId:int = 0;
        private var _isSendEvent:Boolean = false;
        private var _isNewText:Boolean = true;
        private var _limitNum:int = 60;
        private var _isIntoEip:Boolean = true;
        private var _sendTxt:String = "";
        private var _onCheckData:Function;
        private var _onSendFriendChat:Function;
        private var _showActivityList:Array;
        private var _showFactionList:Array;
        private var _downBox:ChatDownBox;
        private var _tipContent:Sprite;
        private var _messageType:int = 1;
        private var _eipDataId:Object;
        private var _eipBar:EipBar;
        private var _eipList:Array;
        private var _postTimer:Timer;
        private var _isClosePost:Boolean = false;
        private var _teceivePostList:Array;
        private var _isMainPostShow:Boolean = false;
        private var _postTimerNum:int = 180;
        private var _postMcNum:int = 0;
        private var _postShowNum:int = 0;
        private var _isEmptyStr:Boolean = false;
        private var _onSendTownFile:Function;
        private var _townFormat:TextFormat;
        private var labaTime:Timer;
        private var _laBaPlayList:Array;
        private var _speed:int = 3;
        private var _labaY:int = 2;
        private var _labaList:Array;
        private var _xy:Array;
        private var _xyForFate:Array;
        private var _serverWarXy:Array;
        private var _LaoBaXY:Array;
        private var _postXY:Array;
        private var _punishmentPostXY:Array;
        private var _stageOffsetX:Number;
        private var _stageOffsetY:Number;
        private var w:int;
        private var h:int;
        private var _stageClip:Point;
        private var _changeType:int = 0;
        private var _typeMultiMission:int = 99;
        private var _chatType:int = 99;

        public function Chat()
        {
            this._systemChatInfo = "<font color=\"#FFF100\">" + ChatLang.SystemChat + "\n</font>";
            this._onTextLink = new Function();
            this._onOpenGm = new Function();
            this._chatShow = this._allType;
            this._timer = new Timer(1000);
            this._btnMcTimer = new Timer(200);
            this._btnList = [{name:"All", type:this._allType, list:this._allList}, {name:"World", type:Mod_Chat_Base.WORLD, list:this._worldList}, {name:"Faction", type:Mod_Chat_Base.FACTION, list:this._factionList}, {name:"Activity", type:Mod_Chat_Base.ACTIVITY, list:this._activityList}, {name:"Gm", type:"GM"}];
            this._onSendChat = new Function();
            this._onCheckData = new Function();
            this._onSendFriendChat = new Function();
            this._showActivityList = [{label:ChatLang.World, type:Mod_Chat_Base.WORLD}, {label:ChatLang.Activity, type:Mod_Chat_Base.ACTIVITY}];
            this._showFactionList = [{label:ChatLang.World, type:Mod_Chat_Base.WORLD}, {label:ChatLang.Activity, type:Mod_Chat_Base.ACTIVITY}, {label:ChatLang.Faction, type:Mod_Chat_Base.FACTION}];
            this._postTimer = new Timer(1000);
            this._onSendTownFile = new Function();
            this.labaTime = new Timer(20);
            this._laBaPlayList = [];
            this._labaList = [];
            this._xy = [0, 203];
            this._xyForFate = [0, 0];
            this._serverWarXy = [350, 130];
            this._LaoBaXY = [-2, -58];
            this._postXY = [321, -90];
            this._punishmentPostXY = [300, -50];
            x = this._xy[0];
            y = this._xy[1];
            this.addCountenance();
            this.addMc();
            this.addEvent();
            this.addInputFile();
            this.addSendFile();
            this.createScorllbar();
            this.addBoxData();
            this.addEipBar();
            this.scrollbarTxt();
            this.addFilters();
            this.laba();
            this._ChatBox._Black.alpha = 0;
            this._chatShow = this._allType;
            this._allList = [];
            this._worldList = [];
            this._activityList = [];
            this._factionList = [];
            this._sendChatList = [];
            this.defaultInfo();
            this._ChatBox._BtnFaction.visible = false;
            this._ChatBox._BtnActivity.visible = false;
            return;
        }// end function

        public function get content() : MovieClip
        {
            return this;
        }// end function

        public function set onTextLink(param1:Function) : void
        {
            this._onTextLink = param1;
            return;
        }// end function

        public function set onOpenGm(param1:Function) : void
        {
            this._onOpenGm = param1;
            return;
        }// end function

        public function getShieldPlayerInfo(param1:String, param2:int) : String
        {
            return chatDataChange.getShieldPlayerInfo(param1, param2);
        }// end function

        public function isShieldPlayer(param1:Object) : Boolean
        {
            return chatDataChange.isShieldPlayer(param1, true);
        }// end function

        public function set tip(param1:ITip) : void
        {
            this._tip = param1;
            this._tip.addTarget(this._ChatBox._Btnmax, ChatLang.BtnMax);
            this._tip.addTarget(this._ChatBox._Btnmin, ChatLang.BtnMin);
            this._tip.addTarget(this._ChatBox._BtnEip, ChatLang.BtnEip);
            this._tip.addTarget(this._ChatBox._BtnAll, ChatLang.BtnAll);
            this._tip.addTarget(this._ChatBox._BtnWorld, ChatLang.World);
            this._tip.addTarget(this._ChatBox._BtnFaction, ChatLang.Faction);
            this._tip.addTarget(this._ChatBox._BtnActivity, ChatLang.Activity);
            this._tip.addTarget(this._ChatBox._BtnGm, "GM");
            return;
        }// end function

        public function clear() : void
        {
            this.clearSendTestEvent();
            this.clearFile();
            this.clearSendFile();
            this.clearScrollbar();
            this.clearScrollberTxt();
            this.clearMc();
            this.clearBox();
            this._tip.removeTarget(this._ChatBox._Btnmax);
            this._tip.removeTarget(this._ChatBox._Btnmin);
            this._tip.removeTarget(this._ChatBox._BtnEip);
            this._tip.removeTarget(this._ChatBox._BtnAll);
            this._tip.removeTarget(this._ChatBox._BtnWorld);
            this._tip.removeTarget(this._ChatBox._BtnFaction);
            this._tip.removeTarget(this._ChatBox._BtnActivity);
            this._tip.removeTarget(this._ChatBox._BtnGm);
            this._ChatBox._Btnmax.removeEventListener(MouseEvent.CLICK, this.btnMaxClick);
            this._ChatBox._Btnmin.removeEventListener(MouseEvent.CLICK, this.btnMinClick);
            this._ChatBox._Send.removeEventListener(MouseEvent.CLICK, this.sendClick);
            this._ChatBox._CheckType.removeEventListener(MouseEvent.CLICK, this.checkTypeClick);
            this._ChatBox._BtnEip.removeEventListener(MouseEvent.CLICK, this.btnEipClick);
            this._ChatBox.removeEventListener(MouseEvent.MOUSE_OVER, this.targetOver);
            this._btnMcTimer.removeEventListener(TimerEvent.TIMER, this.btnTimerEvent);
            this._ChatBox.removeEventListener(MouseEvent.MOUSE_OUT, this.targetOut);
            this.clearBtn();
            return;
        }// end function

        private function addCountenance() : void
        {
            var _loc_1:* = new ChatIcon();
            return;
        }// end function

        private function addEvent() : void
        {
            this._ChatBox.addEventListener(MouseEvent.MOUSE_OVER, this.targetOver);
            this._ChatBox.addEventListener(MouseEvent.MOUSE_OUT, this.targetOut);
            this._ChatBox._Btnmax.addEventListener(MouseEvent.CLICK, this.btnMaxClick);
            this._ChatBox._Btnmin.addEventListener(MouseEvent.CLICK, this.btnMinClick);
            this._ChatBox._Send.addEventListener(MouseEvent.CLICK, this.sendClick);
            this._ChatBox._CheckType.addEventListener(MouseEvent.CLICK, this.checkTypeClick);
            this._ChatBox._BtnEip.addEventListener(MouseEvent.CLICK, this.btnEipClick);
            this._timer.addEventListener(TimerEvent.TIMER, this.timerEvent);
            this._btnMcTimer.addEventListener(TimerEvent.TIMER, this.btnTimerEvent);
            this._ChatBox._BtnEip.buttonMode = true;
            this._ChatBox._CheckType.buttonMode = true;
            this.renderBtn();
            return;
        }// end function

        private function defaultInfo() : void
        {
            this.directlyChatData(this._systemChatInfo, this._allType, true);
            return;
        }// end function

        private function btnTimerEvent(event:TimerEvent) : void
        {
            if (this._btnTimerNum % 2 == 0)
            {
                this._ChatBox._BtnFaction._ShowBtn.alpha = 0;
            }
            else
            {
                this._ChatBox._BtnFaction._ShowBtn.alpha = 1;
            }
            var _loc_2:String = this;
            var _loc_3:* = this._btnTimerNum + 1;
            _loc_2._btnTimerNum = _loc_3;
            return;
        }// end function

        public function set isOpenActivity(param1:Boolean) : void
        {
            if (this._ChatBox._BtnFaction.visible == true)
            {
                return;
            }
            if (param1)
            {
                this._ChatBox._BtnActivity.x = 112;
                this._ChatBox._BtnGm.x = 165;
            }
            else
            {
                this._ChatBox._BtnGm.x = 112;
            }
            this._ChatBox._BtnActivity.visible = param1;
            return;
        }// end function

        public function set isOpenFaction(param1:Boolean) : void
        {
            if (this._ChatBox._BtnActivity.visible == false)
            {
                return;
            }
            if (param1)
            {
                this._ChatBox._BtnActivity.x = 165;
                this._ChatBox._BtnGm.x = 218;
            }
            else
            {
                this._ChatBox._BtnActivity.x = 112;
                this._ChatBox._BtnGm.x = 165;
            }
            this._ChatBox._BtnFaction.visible = param1;
            return;
        }// end function

        public function set changeChat(param1:int) : void
        {
            this.changeChatType(param1);
            return;
        }// end function

        private function targetOver(event:MouseEvent) : void
        {
            this._ChatBox._Black.alpha = 0.3;
            return;
        }// end function

        private function targetOut(event:MouseEvent) : void
        {
            this._ChatBox._Black.alpha = 0;
            return;
        }// end function

        private function renderBtn() : void
        {
            var _loc_3:Object = null;
            var _loc_1:* = this._btnList.length;
            var _loc_2:int = 0;
            while (_loc_2 < _loc_1)
            {
                
                _loc_3 = this._btnList[_loc_2];
                _loc_3.btn = this._ChatBox["_Btn" + _loc_3.name];
                _loc_3.handler = this.btnClick(_loc_3);
                _loc_3.btn.addEventListener(MouseEvent.CLICK, _loc_3.handler);
                if (_loc_3.type != "GM")
                {
                    _loc_3.btn.buttonMode = true;
                    _loc_3.btn._ShowBtn.alpha = 0;
                    _loc_3.btn._ShowBtn.mouseEnabled = false;
                    if (_loc_3.type != this._allType)
                    {
                        _loc_3.btn.gotoAndStop(2);
                    }
                    else
                    {
                        this._gotoMc = _loc_3.btn;
                    }
                }
                _loc_2 = _loc_2 + 1;
            }
            return;
        }// end function

        private function btnClick(param1:Object) : Function
        {
            var data:* = param1;
            var func:* = function (event:MouseEvent) : void
            {
                if (data.type != "GM")
                {
                    changeChatType(data.type);
                }
                else
                {
                    _onOpenGm();
                }
                return;
            }// end function
            ;
            return func;
        }// end function

        private function clearBtn() : void
        {
            var _loc_3:Object = null;
            var _loc_1:* = this._btnList.length;
            var _loc_2:int = 0;
            while (_loc_2 < _loc_1)
            {
                
                _loc_3 = this._btnList[_loc_2];
                _loc_3.btn.removeEventListener(MouseEvent.CLICK, _loc_3.handler);
                _loc_2 = _loc_2 + 1;
            }
            return;
        }// end function

        private function btnMaxClick(event:MouseEvent) : void
        {
            if (this._showChatScale >= 2)
            {
                return;
            }
            var _loc_2:String = this;
            var _loc_3:* = this._showChatScale + 1;
            _loc_2._showChatScale = _loc_3;
            this.changeShowChat();
            return;
        }// end function

        private function btnMinClick(event:MouseEvent) : void
        {
            if (this._showChatScale <= 0)
            {
                return;
            }
            var _loc_2:String = this;
            var _loc_3:* = this._showChatScale - 1;
            _loc_2._showChatScale = _loc_3;
            this.changeShowChat();
            return;
        }// end function

        private function changeShowChat() : void
        {
            if (this._showChatScale == 0)
            {
                this._scrollbar.visible = false;
                this._chatMc.visible = false;
                this._ChatBox._Black.height = 0;
                this._ChatBox._Black.y = 181;
            }
            if (this._showChatScale == 1)
            {
                this._scrollbar.visible = true;
                this._chatMc.visible = true;
                this._scrollbar.scrollbarY = 15;
                this._ChatBox._Black.height = 197;
                this._ChatBox._Black.y = -11.5;
                this._chatMc.y = 2;
                this._scrollbar.targetY = this._chatMc.y;
                this._scrollbar.showHeight = this._showSize;
            }
            if (this._showChatScale == 2)
            {
                this._scrollbar.scrollbarY = -120;
                this._ChatBox._Black.height = 330;
                this._ChatBox._Black.y = -144;
                this._chatMc.y = -130;
                this._scrollbar.targetY = this._chatMc.y;
                this._scrollbar.showHeight = 260;
            }
            this.laoBaY();
            return;
        }// end function

        private function addMc() : void
        {
            this._chatMc = new MovieClip();
            this._chatMc.y = 2;
            this._chatMc.x = 25;
            this._ChatBox.addChild(this._chatMc);
            return;
        }// end function

        private function clearMc() : void
        {
            if (this._chatMc != null)
            {
            }
            if (this._chatMc.parent)
            {
                this._chatMc.parent.removeChild(this._chatMc);
                this._chatMc = null;
            }
            return;
        }// end function

        private function addInputFile() : void
        {
            this._textFormat = new TextFormat("新宋体", 13);
            this._textFormat.leading = 5;
            this._chatText = new RichTextField();
            this._chatText.textfield.selectable = false;
            this._chatText.textfield.autoSize = TextFieldAutoSize.LEFT;
            this._chatText.placeholderMarginH = 1;
            this._chatText.textfield.textColor = 16777215;
            this._chatText.textfield.mouseWheelEnabled = false;
            this._chatText.html = true;
            this._chatText.mouseEnabled = false;
            this._chatText.defaultTextFormat = this._textFormat;
            this._chatMc.addChild(this._chatText);
            this._chatText.addEventListener(TextEvent.LINK, this.textLink);
            return;
        }// end function

        private function textLink(event:TextEvent) : void
        {
            var _loc_2:* = event.text;
            if (/^Player|^Item|^Fate|^ViewReport|^FactionSeal|^Soul|^Achievement|^Faction|^NineRegions|^BeelzebubTrials|^GoToJiHuiSuo""^Player|^Item|^Fate|^ViewReport|^FactionSeal|^Soul|^Achievement|^Faction|^NineRegions|^BeelzebubTrials|^GoToJiHuiSuo/.test(_loc_2))
            {
                this._onTextLink(event);
            }
            else
            {
                this.changeChatType(int(_loc_2));
            }
            return;
        }// end function

        private function changeChatType(param1:int) : void
        {
            if (this._chatShow == param1)
            {
                return;
            }
            this._chatShow = param1;
            switch(param1)
            {
                case Mod_Chat_Base.WORLD:
                {
                    this._messageType = Mod_Chat_Base.WORLD;
                    this._ChatBox._CheckType._Type.gotoAndStop(1);
                    this._gotoMc._ShowBtn.alpha = 0;
                    this._gotoMc.gotoAndStop(2);
                    this._gotoMc = this._ChatBox._BtnWorld;
                    this._ChatBox._BtnWorld.gotoAndStop(1);
                    this.renderChatData(this._worldList);
                    break;
                }
                case Mod_Chat_Base.FACTION:
                {
                    this._messageType = Mod_Chat_Base.FACTION;
                    this._ChatBox._CheckType._Type.gotoAndStop(2);
                    this._btnTimerNum = 0;
                    this._btnMcTimer.stop();
                    this._gotoMc._ShowBtn.alpha = 0;
                    this._gotoMc.gotoAndStop(2);
                    this._gotoMc = this._ChatBox._BtnFaction;
                    this._ChatBox._BtnFaction.gotoAndStop(1);
                    this.renderChatData(this._factionList);
                    break;
                }
                case Mod_Chat_Base.ACTIVITY:
                {
                    this._messageType = Mod_Chat_Base.ACTIVITY;
                    this._ChatBox._CheckType._Type.gotoAndStop(3);
                    this._gotoMc._ShowBtn.alpha = 0;
                    this._gotoMc.gotoAndStop(2);
                    this._gotoMc = this._ChatBox._BtnActivity;
                    this._ChatBox._BtnActivity.gotoAndStop(1);
                    this.renderChatData(this._activityList);
                    break;
                }
                case this._allType:
                {
                    this._messageType = Mod_Chat_Base.WORLD;
                    this._ChatBox._CheckType._Type.gotoAndStop(1);
                    this._gotoMc._ShowBtn.alpha = 0;
                    this._gotoMc.gotoAndStop(2);
                    this._gotoMc = this._ChatBox._BtnAll;
                    this._ChatBox._BtnAll.gotoAndStop(1);
                    this.renderChatData(this._allList);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function addSendFile() : void
        {
            this._sendText = new RichTextField();
            this._sendText.x = 55;
            this._sendText.y = 164;
            this._sendText.setSize(178, 28);
            this._sendText.type = RichTextField.INPUT;
            this._sendText.focusRect = false;
            this._sendText.textfield.multiline = false;
            this._sendTextFormat = new TextFormat("", 16, 16777215);
            this._sendText.defaultTextFormat = this._sendTextFormat;
            this._ChatBox.addChild(this._sendText);
            this._sendText.addEventListener(MouseEvent.CLICK, this.sendTextClick);
            return;
        }// end function

        private function clearSendFile() : void
        {
            if (this._sendText != null)
            {
            }
            if (this._sendText.parent)
            {
                this._sendTextFormat = null;
                this._sendText.removeEventListener(MouseEvent.CLICK, this.sendTextClick);
                this._sendText.parent.removeChild(this._sendText);
                this._sendText = null;
            }
            return;
        }// end function

        private function addFilters() : void
        {
            var _loc_1:* = new DropShadowFilter();
            _loc_1.blurX = 3;
            _loc_1.blurY = 3;
            _loc_1.distance = 0;
            _loc_1.alpha = 0.6;
            _loc_1.strength = 10;
            _loc_1.color = 0;
            _loc_1.quality = 1;
            this._chatText.textfield.filters = [_loc_1];
            return;
        }// end function

        private function clearFile() : void
        {
            if (this._chatText != null)
            {
            }
            if (this._chatText.parent)
            {
                this._chatText.clear();
                this._chatText.parent.removeChild(this._chatText);
                this._chatText = null;
                this._textFormat = null;
            }
            return;
        }// end function

        private function createScorllbar() : void
        {
            this._scrollbar = new Scrollbar();
            this._scrollbar.showWidth = 350;
            this._scrollbar.showHeight = this._showSize;
            this._scrollbar.moveNum = 7;
            this._scrollbar.speed = 8;
            this._scrollbar.scrollbarX = 5;
            this._scrollbar.showBottom = true;
            this._scrollbar.visibleScrollbar = false;
            return;
        }// end function

        private function clearScrollbar() : void
        {
            if (this._scrollbar != null)
            {
                this._scrollbar.target = null;
                this._scrollbar = null;
            }
            return;
        }// end function

        public function set playerId(param1:int) : void
        {
            this._playerId = param1;
            return;
        }// end function

        public function set nickName(param1:String) : void
        {
            this._nickName = param1;
            return;
        }// end function

        public function set getRemoveSuffixData(param1:Function) : void
        {
            this._removeSuffix = param1;
            return;
        }// end function

        public function set sendSelf(param1:Object) : void
        {
            var _loc_2:Object = {};
            _loc_2.eipIndex = param1.eipIndex;
            _loc_2.eipNum = param1.eipNum;
            _loc_2.fileColor = 16777215;
            _loc_2.msgTxt = param1.message;
            _loc_2.msgType = param1.messageType;
            _loc_2.playId = this._playerId;
            _loc_2.playName = this._nickName;
            _loc_2.showName = this._removeSuffix(_loc_2.playName);
            _loc_2.sex = param1.sex;
            this.getChatData = [_loc_2];
            this.getTownPlaySay = [_loc_2];
            return;
        }// end function

        public function set getChatData(param1:Array) : void
        {
            var _loc_2:* = chatDataChange.renderMessage(param1, this._typeMultiMission);
            this.autoChatData(_loc_2, true);
            return;
        }// end function

        private function autoChatData(param1:Array, param2:Boolean) : void
        {
            var _loc_5:Object = null;
            var _loc_3:* = param1.length;
            var _loc_4:int = 0;
            while (_loc_4 < _loc_3)
            {
                
                _loc_5 = param1[_loc_4];
                this.renderChat(_loc_5, param2);
                _loc_4 = _loc_4 + 1;
            }
            return;
        }// end function

        public function directlyChatData(param1:String, param2:int, param3:Boolean) : void
        {
            var _loc_4:* = this.chatDataToList(param1, param2);
            this.autoChatData(_loc_4, param3);
            return;
        }// end function

        public function addMainShow(param1:String, param2:int, param3:Boolean) : void
        {
            var _loc_7:Object = null;
            var _loc_4:* = this.chatDataToList(param1, param2);
            var _loc_5:* = _loc_4.length;
            var _loc_6:int = 0;
            while (_loc_6 < _loc_5)
            {
                
                _loc_7 = _loc_4[_loc_6];
                _loc_7.type = this._chatShow;
                this.renderChat(_loc_7, param3, true);
                _loc_6 = _loc_6 + 1;
            }
            return;
        }// end function

        private function chatDataToList(param1:String, param2:int) : Array
        {
            var _loc_3:* = <rtf>r
n	t	t	t	t	t	t	t<text></text>r
n	t	t	t	t	t	t	t<sprites>r
n	t	t	t	t	t	t	t</sprites>r
n	t	t	t	t	t	t	t</rtf>")("<rtf>
							<text></text>
							<sprites>
							</sprites>
							</rtf>;
            _loc_3.text[0] = param1;
            var _loc_4:Object = {};
            _loc_4.type = param2;
            _loc_4.xmlInfo = _loc_3;
            return [_loc_4];
        }// end function

        private function renderChat(param1:Object, param2:Boolean, param3:Boolean = false, param4:Boolean = true) : void
        {
            if (this._typeMultiMission == this._chatType)
            {
                switch(param1.type)
                {
                    case this._allType:
                    {
                        if (param3)
                        {
                            this.renderAll(param1, this._allList, this._allType, param4);
                            return;
                        }
                        break;
                    }
                    case Mod_Chat_Base.WORLD:
                    {
                        this.renderAll(param1, this._worldList, Mod_Chat_Base.WORLD, param4);
                        break;
                    }
                    case Mod_Chat_Base.ACTIVITY:
                    {
                        this.renderAll(param1, this._activityList, Mod_Chat_Base.ACTIVITY, param4);
                        break;
                    }
                    case Mod_Chat_Base.FACTION:
                    {
                        this.renderAll(param1, this._factionList, Mod_Chat_Base.FACTION, param4);
                        if (this._chatShow != param1.type)
                        {
                            this._btnMcTimer.start();
                        }
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
                if (param2 == false)
                {
                    return;
                }
                this.renderAll(param1, this._allList, this._allType, param4);
            }
            else if (param1.type == Mod_Chat_Base.ACTIVITY)
            {
                this.renderAll(param1, this._allList, Mod_Chat_Base.ACTIVITY, param4);
            }
            return;
        }// end function

        private function renderAll(param1:Object, param2:Array, param3:int, param4:Boolean) : void
        {
            var _loc_6:int = 0;
            var _loc_5:Boolean = false;
            if (param4)
            {
                param2.push(param1);
                if (param2.length > 40)
                {
                    _loc_6 = 0;
                    while (_loc_6 < 20)
                    {
                        
                        param2.shift();
                        _loc_6 = _loc_6 + 1;
                    }
                    _loc_5 = true;
                }
                else
                {
                    _loc_5 = false;
                }
            }
            if (this._chatShow != param3)
            {
                return;
            }
            if (param4)
            {
                if (_loc_5 == false)
                {
                    this._chatText.importXML(param1.xmlInfo);
                }
                else
                {
                    this.renderChatData(param2);
                }
            }
            else
            {
                this.renderChatData(param2);
            }
            this._chatText.setSize(300, this._chatText.textfield.height);
            this._scrollbar.mainHeight = this._chatText.textfield.height - 2;
            this._scrollbar.target = this._chatMc;
            return;
        }// end function

        private function renderChatData(param1:Array) : void
        {
            this._chatText.clear();
            var _loc_2:* = param1.length;
            var _loc_3:int = 0;
            while (_loc_3 < _loc_2)
            {
                
                this._chatText.importXML(param1[_loc_3].xmlInfo);
                _loc_3 = _loc_3 + 1;
            }
            this._chatText.setSize(300, this._chatText.textfield.height);
            this._scrollbar.mainHeight = this._chatText.textfield.height - 2;
            this._scrollbar.target = this._chatMc;
            return;
        }// end function

        public function set onSendChat(param1:Function) : void
        {
            this._onSendChat = param1;
            return;
        }// end function

        private function timerEvent(event:TimerEvent) : void
        {
            if (this._timerNum <= 0)
            {
                this._timer.stop();
            }
            else
            {
                var _loc_2:String = this;
                var _loc_3:* = this._timerNum - 1;
                _loc_2._timerNum = _loc_3;
            }
            return;
        }// end function

        private function sendClick(event:MouseEvent) : void
        {
            this.sendChatData();
            return;
        }// end function

        private function sendChatData() : void
        {
            var _loc_1:* = <rtf>r
n	t	t	t	t	t	t	t<text></text>r
n	t	t	t	t	t	t	t<sprites>r
n	t	t	t	t	t	t	t</sprites>r
n	t	t	t	t	t	t	t</rtf>")("<rtf>
							<text></text>
							<sprites>
							</sprites>
							</rtf>;
            var _loc_2:Object = {};
            _loc_2.type = this._chatShow;
            _loc_2.xmlInfo = _loc_1;
            if (this._sendText.textfield.text.length <= 0)
            {
                _loc_1.text[0] = "<font color=\"#ffffff\">" + ChatLang.NoEmpty + "</font>";
                this.renderChat(_loc_2, false, true);
                return;
            }
            if (this._timerNum > 0)
            {
                _loc_1.text[0] = "<font color=\"#ffffff\">" + ChatLang.ToNag + "</font>";
                this.renderChat(_loc_2, false, true);
                return;
            }
            this._timerNum = 4;
            this._timer.start();
            this.renderSendData();
            return;
        }// end function

        private function renderSendData() : void
        {
            var _loc_1:* = this._sendText.exportXML();
            var _loc_2:* = _loc_1.text[0];
            var _loc_3:* = _loc_1.sprites.sprite.length();
            var _loc_4:Array = [];
            var _loc_5:Array = [];
            var _loc_6:int = 0;
            while (_loc_6 < _loc_3)
            {
                
                _loc_4.push(this._eipDataId[_loc_1.sprites.sprite[_loc_6].@src].id);
                _loc_5.push(_loc_1.sprites.sprite[_loc_6].@index);
                _loc_6 = _loc_6 + 1;
            }
            var _loc_7:* = _loc_4.join(",");
            var _loc_8:* = _loc_5.join(",");
            var _loc_9:Object = {};
            _loc_9.messageType = this._messageType;
            _loc_9.message = _loc_2;
            _loc_9.eipNum = _loc_7;
            _loc_9.eipIndex = _loc_8;
            this._onSendChat(_loc_9);
            this._sendText.clear();
            this._sendChatList.push(_loc_1);
            if (this._sendChatList.length > 10)
            {
                this._sendChatList.splice(0, 1);
            }
            return;
        }// end function

        private function sendTextClick(event:MouseEvent) : void
        {
            this.clickFile();
            return;
        }// end function

        private function clickFile() : void
        {
            if (this._isSendEvent == false)
            {
                stage.focus = this._sendText.textfield;
                stage.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUpHandler);
                stage.addEventListener(MouseEvent.MOUSE_DOWN, this.stageMouseDown);
                this._sendText.addEventListener(Event.CHANGE, this.sendTextChange);
                this._sendText.textfield.addEventListener(KeyboardEvent.KEY_UP, this.chatInfoKeyUp);
                this._isSendEvent = true;
            }
            return;
        }// end function

        private function chatInfoKeyUp(event:KeyboardEvent) : void
        {
            if (event.keyCode == Keyboard.SPACE)
            {
                event.stopPropagation();
            }
            return;
        }// end function

        private function clearSendTestEvent() : void
        {
            stage.removeEventListener(KeyboardEvent.KEY_UP, this.onKeyUpHandler);
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.stageMouseDown);
            this._sendText.removeEventListener(Event.CHANGE, this.sendTextChange);
            this._sendText.textfield.removeEventListener(KeyboardEvent.KEY_UP, this.chatInfoKeyUp);
            return;
        }// end function

        private function checkTypeClick(event:MouseEvent) : void
        {
            if (this._ChatBox._CheckType.buttonMode == false)
            {
                return;
            }
            if (this._ChatBox._BtnFaction.visible)
            {
                this.renderBoxData("showType", this._showFactionList);
            }
            else if (this._ChatBox._BtnActivity.visible)
            {
                this.renderBoxData("showType", this._showActivityList);
            }
            return;
        }// end function

        private function onKeyUpHandler(event:KeyboardEvent) : void
        {
            if (event.keyCode == 17)
            {
                return;
            }
            if (event.keyCode == 13)
            {
                this.sendChatData();
                return;
            }
            if (this._sendChatList.length <= 0)
            {
                return;
            }
            if (event.keyCode == Keyboard.UP)
            {
                this._isNewText = false;
                this._sendText.clear();
                this._sendText.importXML(this._sendChatList[this._sendChatId]);
                this._sendText.caretIndex = this._sendText.textfield.length;
                var _loc_2:String = this;
                var _loc_3:* = this._sendChatId + 1;
                _loc_2._sendChatId = _loc_3;
            }
            if (event.keyCode == Keyboard.DOWN)
            {
                this._isNewText = false;
                this._sendText.clear();
                this._sendText.importXML(this._sendChatList[this._sendChatId]);
                this._sendText.caretIndex = this._sendText.textfield.length;
                var _loc_2:String = this;
                var _loc_3:* = this._sendChatId - 1;
                _loc_2._sendChatId = _loc_3;
            }
            this.limitNum();
            return;
        }// end function

        private function limitNum() : void
        {
            var _loc_1:* = this._sendChatList.length - 1;
            if (this._sendChatId > _loc_1)
            {
                this._sendChatId = 0;
            }
            if (this._sendChatId < 0)
            {
                this._sendChatId = _loc_1;
            }
            return;
        }// end function

        private function stageMouseDown(event:MouseEvent) : void
        {
            if (!this._sendText.hitTestPoint(stage.mouseX, stage.mouseY))
            {
            }
            if (!this._ChatBox._BtnEip.hitTestPoint(stage.mouseX, stage.mouseY))
            {
            }
            if (!this._eipBar.hitTestPoint(stage.mouseX, stage.mouseY))
            {
            }
            if (!this._ChatBox._Send.hitTestPoint(stage.mouseX, stage.mouseY))
            {
                this.clearSendTestEvent();
                stage.focus = null;
                this._isSendEvent = false;
            }
            return;
        }// end function

        private function sendTextChange(event:Event) : void
        {
            this.testLimit();
            return;
        }// end function

        private function testLimit() : void
        {
            var _loc_1:* = this._sendText.exportXML();
            var _loc_2:* = _loc_1.text[0];
            var _loc_3:* = this._sendTxt.length;
            var _loc_4:* = _loc_1.sprites.sprite.length();
            var _loc_5:* = this.countStr(_loc_2);
            if (_loc_5 >= 60)
            {
                this._sendText.textfield.maxChars = _loc_3;
            }
            else
            {
                this._sendText.textfield.maxChars = 60;
                this._sendTxt = _loc_2;
            }
            if (_loc_4 >= 1)
            {
                this._sendText.y = 157;
            }
            else
            {
                this._sendText.y = 164;
            }
            if (_loc_4 >= 10)
            {
                this._isIntoEip = false;
            }
            else
            {
                this._isIntoEip = true;
            }
            return;
        }// end function

        private function countStr(param1:String) : int
        {
            var _loc_2:int = 0;
            var _loc_3:* = param1.length;
            var _loc_4:int = 0;
            while (_loc_4 < _loc_3)
            {
                
                if (param1.charCodeAt(_loc_4) > 127)
                {
                    _loc_2 = _loc_2 + 2;
                }
                else
                {
                    _loc_2 = _loc_2 + 1;
                }
                _loc_4 = _loc_4 + 1;
            }
            return _loc_2;
        }// end function

        public function set onCheckData(param1:Function) : void
        {
            this._onCheckData = param1;
            return;
        }// end function

        public function set onSendFriendChat(param1:Function) : void
        {
            this._onSendFriendChat = param1;
            return;
        }// end function

        private function addBoxData() : void
        {
            this._downBox = new ChatDownBox();
            addChild(this._downBox);
            this._downBox.onSendData = function (param1:Object, param2:Object) : void
            {
                _messageType = param1.type;
                changeChatType(param1.type);
                removeTipContent();
                return;
            }// end function
            ;
            this._downBox.visible = false;
            return;
        }// end function

        private function renderBoxData(param1:String, param2:Array) : void
        {
            var newPoint:Point;
            var handler:Function;
            var type:* = param1;
            var list:* = param2;
            this._downBox.boxWidth = 50;
            this._downBox.getBoxList = list;
            newPoint = localToGlobal(new Point(this._ChatBox.x, this._ChatBox.y));
            newPoint.y = newPoint.y - (this._downBox.height + 10);
            if (this._downBox.parent)
            {
                handler = function () : void
            {
                _tipContent = _tip.clickToOpen(_downBox);
                _tipContent.x = newPoint.x - _tip.stageOffset.x + _ChatBox._CheckType.x;
                _tipContent.y = newPoint.y - _tip.stageOffset.y + _ChatBox._CheckType.y;
                _downBox.visible = true;
                return;
            }// end function
            ;
                setTimeout(handler, 10);
            }
            return;
        }// end function

        private function removeTipContent() : void
        {
            if (this._tipContent)
            {
            }
            if (this._tipContent.parent)
            {
                this._tipContent.parent.removeChild(this._tipContent);
                this._tipContent = null;
            }
            return;
        }// end function

        private function clearBox() : void
        {
            if (this._downBox != null)
            {
            }
            if (this._downBox.parent)
            {
                this._downBox.clear();
                this._downBox.parent.removeChild(this._downBox);
                this._downBox = null;
            }
            return;
        }// end function

        private function btnEipClick(event:MouseEvent) : void
        {
            this.renderEipBar();
            return;
        }// end function

        private function renderEipData() : void
        {
            this._eipDataId = {};
            var _loc_1:int = 1;
            while (_loc_1 <= 35)
            {
                
                this._eipDataId["eip" + _loc_1] = {};
                this._eipDataId["eip" + _loc_1].id = _loc_1;
                _loc_1 = _loc_1 + 1;
            }
            return;
        }// end function

        private function addEipBar() : void
        {
            this.renderEipData();
            this._eipBar = new EipBar();
            this._ChatBox.addChild(this._eipBar);
            this._eipBar.visible = false;
            this._eipBar.onSendEip = function (param1:Object) : void
            {
                var _loc_2:XML = null;
                var _loc_3:Object = null;
                testLimit();
                if (_isIntoEip == true)
                {
                    clickFile();
                    _sendText.insertSprite(param1.name, _sendText.textfield.caretIndex);
                    var _loc_4:* = _sendText;
                    var _loc_5:* = _sendText.caretIndex + 1;
                    _loc_4.caretIndex = _loc_5;
                }
                else
                {
                    _loc_2 = <rtf>r
n	t	t	t	t	t	t	t	t	t<text></text>r
n	t	t	t	t	t	t	t	t	t<sprites>r
n	t	t	t	t	t	t	t	t	t</sprites>r
n	t	t	t	t	t	t	t	t	t</rtf>")("<rtf>
									<text></text>
									<sprites>
									</sprites>
									</rtf>;
                    _loc_3 = {};
                    _loc_3.type = _chatShow;
                    _loc_3.xmlInfo = _loc_2;
                    _loc_2.text[0] = "<font color=\"#ffffff\">" + ChatLang.IconOver + "</font>";
                    renderChat(_loc_3, false, true);
                }
                return;
            }// end function
            ;
            return;
        }// end function

        private function renderEipBar() : void
        {
            var newPoint:Point;
            var handler:Function;
            newPoint = localToGlobal(new Point(this._ChatBox.x, this._ChatBox.y));
            if (this._eipBar.parent)
            {
                handler = function () : void
            {
                _tipContent = _tip.clickToOpen(_eipBar);
                _tipContent.x = newPoint.x - _tip.stageOffset.x + _ChatBox._BtnEip.x;
                _tipContent.y = newPoint.y - _tip.stageOffset.y + _ChatBox._BtnEip.y - _eipBar.height - 10;
                _eipBar.visible = true;
                return;
            }// end function
            ;
                setTimeout(handler, 10);
            }
            return;
        }// end function

        private function scrollbarTxt() : void
        {
            this._PostBox._PostInfo.autoSize = TextFieldAutoSize.LEFT;
            this._PostBox._PostClose.addEventListener(MouseEvent.CLICK, this.postCloseHandler);
            this._postTimer.addEventListener(TimerEvent.TIMER, this.postTimerEvent);
            this._postTimer.start();
            return;
        }// end function

        private function clearScrollberTxt() : void
        {
            this._PostBox._PostClose.removeEventListener(MouseEvent.CLICK, this.postCloseHandler);
            this._postTimer.removeEventListener(TimerEvent.TIMER, this.postTimerEvent);
            this._postTimer.stop();
            return;
        }// end function

        private function postCloseHandler(event:MouseEvent) : void
        {
            this._PostBox.visible = false;
            this._isClosePost = true;
            this.showPost();
            return;
        }// end function

        public function set getReceivePostList(param1:Array) : void
        {
            if (this._teceivePostList == null)
            {
                this._teceivePostList = [];
            }
            this._isClosePost = false;
            this._teceivePostList = param1;
            this._postMcNum = 0;
            this.renderPostTxt();
            return;
        }// end function

        public function set visiblePost(param1:Boolean) : void
        {
            this._isMainPostShow = param1;
            this.showPost();
            return;
        }// end function

        private function postTimerEvent(event:TimerEvent) : void
        {
            if (this._postTimerNum <= 0)
            {
                this._postTimerNum = 180;
                if (this._postMcNum == 1)
                {
                    this._postMcNum = 0;
                }
                else
                {
                    this._postMcNum = 1;
                }
                this.showPost();
            }
            else
            {
                var _loc_2:String = this;
                var _loc_3:* = this._postTimerNum - 1;
                _loc_2._postTimerNum = _loc_3;
            }
            if (this._postTimerNum)
            {
            }
            if (this._postTimerNum % 10 == 0)
            {
                var _loc_2:String = this;
                var _loc_3:* = this._postShowNum + 1;
                _loc_2._postShowNum = _loc_3;
                this.renderPostTxt();
            }
            return;
        }// end function

        private function renderPostTxt() : void
        {
            var _loc_5:int = 0;
            if (this._teceivePostList != null)
            {
            }
            if (this._teceivePostList[0] == null)
            {
                this._isEmptyStr = true;
                this.showPost();
                return;
            }
            if (this._teceivePostList[this._postShowNum] == null)
            {
                this._postShowNum = 0;
            }
            var _loc_1:* = this._teceivePostList[this._postShowNum];
            var _loc_2:* = /<a""<a/;
            var _loc_3:* = _loc_2.test(_loc_1.html);
            var _loc_4:String = "";
            this._isEmptyStr = isEmptyStr(_loc_1.html);
            this.showPost();
            _loc_1.html = "<b>" + _loc_1.html + "</b>";
            if (_loc_3 == false)
            {
                _loc_4 = _loc_1.html;
            }
            else
            {
                _loc_4 = "<u>" + _loc_1.html + "</u>";
            }
            this._PostBox._PostInfo.htmlText = _loc_4;
            this._PostBox._PostMiddle.width = this._PostBox._PostInfo.width + 10;
            this._PostBox._PostRight.x = this._PostBox._PostMiddle.width + this._PostBox._PostLeft.width;
            this._PostBox._PostClose.x = this._PostBox._PostMiddle.width + this._PostBox._PostLeft.width - 5;
            this._PostBox.x = (stage.stageWidth - this._PostBox.width) / 2;
            if (this._stageClip != null)
            {
                _loc_5 = y - this._xy[1];
                this._PostBox.x = (this.w - this._stageClip.x - this._PostBox.width) / 2;
                this._PostBox.y = this._postXY[1] - _loc_5;
            }
            return;
        }// end function

        private function showPost() : void
        {
            if (this._isClosePost)
            {
                this._PostBox.visible = false;
                return;
            }
            if (this._isMainPostShow)
            {
                if (!this._isEmptyStr)
                {
                }
                if (this._postMcNum == 1)
                {
                    this._PostBox.visible = false;
                }
                else
                {
                    this._PostBox.visible = true;
                }
            }
            else
            {
                this._PostBox.visible = false;
            }
            return;
        }// end function

        public function set getPunishmentPostList(param1:String) : void
        {
            if (isEmptyStr(param1))
            {
                this._PunishmentPostBox.visible = false;
            }
            else
            {
                this._PunishmentPostBox._PostInfo.autoSize = TextFieldAutoSize.LEFT;
                this._PunishmentPostBox.visible = true;
                this.renderPunishmentPostTxt(param1);
            }
            return;
        }// end function

        private function renderPunishmentPostTxt(param1:String) : void
        {
            var _loc_5:int = 0;
            var _loc_2:* = /<a""<a/;
            var _loc_3:* = _loc_2.test(param1);
            var _loc_4:String = "";
            _loc_4 = "<b>" + param1 + "</b>";
            if (_loc_3)
            {
                _loc_4 = "<u>" + _loc_4 + "</u>";
            }
            this._PunishmentPostBox._PostInfo.htmlText = _loc_4;
            this._PunishmentPostBox._PostMiddle.width = this._PostBox._PostInfo.width + 10;
            this._PunishmentPostBox._PostRight.x = this._PostBox._PostMiddle.width + this._PostBox._PostLeft.width;
            this._PunishmentPostBox.x = (stage.stageWidth - this._PostBox.width) / 2;
            if (this._stageClip != null)
            {
                _loc_5 = y - this._xy[1];
                this._PunishmentPostBox.x = (this.w - this._stageClip.x - this._PunishmentPostBox.width) / 2;
                this._PunishmentPostBox.y = this._punishmentPostXY[1] - _loc_5;
            }
            return;
        }// end function

        public function set getTownPlaySay(param1:Array) : void
        {
            var _loc_2:* = chatDataChange.townChatInfo(param1);
            this.towmMsgFile(_loc_2[0]);
            return;
        }// end function

        public function set onSendTownFile(param1:Function) : void
        {
            this._onSendTownFile = param1;
            return;
        }// end function

        private function towmMsgFile(param1:Object) : void
        {
            var _loc_2:* = new Sprite();
            var _loc_3:* = new RichTextField();
            _loc_3.textfield.autoSize = TextFieldAutoSize.LEFT;
            _loc_3.textfield.selectable = false;
            _loc_3.setSize(155, _loc_3.textfield.height);
            _loc_3.html = true;
            this._townFormat = new TextFormat("", 13, 0);
            _loc_3.defaultTextFormat = this._townFormat;
            _loc_2.addChild(_loc_3);
            _loc_3.clear();
            _loc_3.importXML(param1.xmlInfo);
            if (_loc_3.textfield.width >= 155)
            {
                _loc_3.textfield.wordWrap = true;
                _loc_3.setSize(155, _loc_3.textfield.height);
            }
            else
            {
                _loc_3.setSize(_loc_3.textfield.width, _loc_3.textfield.height);
            }
            param1.file = _loc_2;
            this._onSendTownFile(param1);
            return;
        }// end function

        private function laba() : void
        {
            this._LaoBa._Black.visible = false;
            this.labaTime.addEventListener(TimerEvent.TIMER, this.labaTimeHandler);
            return;
        }// end function

        private function labaTimeHandler(event:TimerEvent) : void
        {
            this.labaMcPlay();
            this.clearLaBa();
            return;
        }// end function

        private function addLaBaFile(param1:Object) : void
        {
            var data:* = param1;
            var laBaFile:* = new ChatIconFile();
            var mcLaBa:* = new MCLaBa();
            mcLaBa.x = 7;
            var box:* = new MovieClip();
            box.alpha = 0;
            box.x = 0;
            box.y = 60;
            laBaFile.onTextLink = function (event:TextEvent) : void
            {
                _onTextLink(event);
                return;
            }// end function
            ;
            laBaFile.onFileScor = function (param1:ChatIconFile) : void
            {
                if (param1.height < 30)
                {
                    _labaY = 30;
                }
                else
                {
                    _labaY = 2;
                }
                labaTime.start();
                return;
            }// end function
            ;
            laBaFile.x = 28;
            laBaFile.getChatData(data);
            this._LaoBa.addChild(box);
            box.addChild(laBaFile);
            box.addChild(mcLaBa);
            var obj:Object;
            obj.mcType = 1;
            obj.mcTime = 1500;
            obj.file = box;
            obj.txt = laBaFile;
            obj.laba = mcLaBa;
            obj.clearAble = false;
            this._laBaPlayList.push(obj);
            return;
        }// end function

        public function getLaBaData(param1:Object) : void
        {
            this._labaList.push(param1);
            this.renderLaBa();
            return;
        }// end function

        private function renderLaBa() : void
        {
            var _loc_2:Object = null;
            var _loc_3:Object = null;
            var _loc_1:* = this._laBaPlayList.length;
            if (this._labaList.length <= 0)
            {
                return;
            }
            if (_loc_1 < 2)
            {
                if (_loc_1 > 0)
                {
                    _loc_3 = this._laBaPlayList[0];
                    if (_loc_3.mcType == 1)
                    {
                        return;
                    }
                    _loc_3.mcType = 3;
                }
                _loc_2 = this._labaList[0];
                this.addLaBaFile(_loc_2);
                this._labaList.shift();
            }
            return;
        }// end function

        private function labaMcPlay() : void
        {
            var _loc_3:Object = null;
            var _loc_1:* = this._laBaPlayList.length;
            var _loc_2:int = 0;
            while (_loc_2 < _loc_1)
            {
                
                _loc_3 = this._laBaPlayList[_loc_2];
                if (_loc_3.clearAble == false)
                {
                    if (_loc_3.mcType == 1)
                    {
                        this.labaMC1(_loc_3);
                    }
                    if (_loc_3.mcType == 2)
                    {
                        this.labaMC2(_loc_3);
                    }
                    if (_loc_3.mcType == 3)
                    {
                        this.labaMC3(_loc_3);
                    }
                }
                _loc_2 = _loc_2 + 1;
            }
            return;
        }// end function

        private function labaMC1(param1:Object) : void
        {
            if (param1.file.y > this._labaY)
            {
                param1.file.y = param1.file.y - this._speed;
                if (param1.file.alpha < 1)
                {
                    param1.file.alpha = param1.file.alpha + 0.1;
                }
            }
            else
            {
                param1.file.y = this._labaY;
                param1.mcType = 2;
                this.renderLaBa();
            }
            return;
        }// end function

        private function labaMC2(param1:Object) : void
        {
            if (param1.mcTime > 0)
            {
                var _loc_2:* = param1;
                var _loc_3:* = param1.mcTime - 1;
                _loc_2.mcTime = _loc_3;
            }
            else
            {
                param1.mcType = 3;
            }
            return;
        }// end function

        private function labaMC3(param1:Object) : void
        {
            if (param1.file.alpha > 0)
            {
                param1.file.y = param1.file.y - this._speed;
                param1.file.alpha = param1.file.alpha - 0.1;
            }
            else
            {
                param1.clearAble = true;
            }
            return;
        }// end function

        private function clearLaBa() : void
        {
            var _loc_3:Object = null;
            var _loc_1:* = this._laBaPlayList.length;
            var _loc_2:* = _loc_1 - 1;
            while (_loc_2 >= 0)
            {
                
                _loc_3 = this._laBaPlayList[_loc_2];
                if (_loc_3.clearAble)
                {
                    _loc_3.txt.clear();
                    _loc_3.txt.parent.removeChild(_loc_3.txt);
                    _loc_3.txt = null;
                    _loc_3.laba.parent.removeChild(_loc_3.laba);
                    _loc_3.laba = null;
                    _loc_3.file.parent.removeChild(_loc_3.file);
                    _loc_3.file = null;
                    this._laBaPlayList.splice(_loc_2, 1);
                }
                _loc_2 = _loc_2 - 1;
            }
            if (this._laBaPlayList.length <= 0)
            {
                this.labaTime.stop();
            }
            return;
        }// end function

        private function laBaTextLink(event:TextEvent) : void
        {
            this._onTextLink(event);
            return;
        }// end function

        public function reposition(param1:int, param2:int, param3:int, param4:int, param5:Point) : void
        {
            if (stage == null)
            {
                return;
            }
            this.w = Math.max(param1, Math.min(param3, stage.stageWidth));
            this.h = Math.max(param2, Math.min(param4, stage.stageHeight));
            this._stageClip = param5;
            var _loc_6:* = this._xy;
            if (this._changeType == 0)
            {
                _loc_6 = this._xy;
            }
            if (this._changeType == 0)
            {
                this._ChatBox.y = Math.max(_loc_6[1] - param5.y, Math.min(param4, stage.stageHeight) - (param2 - _loc_6[1]));
            }
            this.laoBaY();
            this._PostBox.x = (this.w - this._stageClip.x - this._PostBox.width) / 2;
            this._PostBox.y = this._postXY[1];
            this._PunishmentPostBox.x = (this.w - this._stageClip.x - this._PunishmentPostBox.width) / 2;
            this._PunishmentPostBox.y = this._punishmentPostXY[1];
            return;
        }// end function

        private function laoBaY() : void
        {
            switch(this._showChatScale)
            {
                case 0:
                {
                    this._LaoBa.y = this._ChatBox.y + this._ChatBox._Black.y - this._LaoBa.height - 50;
                    break;
                }
                case 1:
                case 2:
                {
                    this._LaoBa.y = this._ChatBox.y + this._ChatBox._Black.y - this._LaoBa.height - 5;
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function set changePoint(param1:int) : void
        {
            this._changeType = param1;
            this._ChatBox._Btnmax.visible = param1 == 0;
            this._ChatBox._Btnmin.visible = param1 == 0;
            if (param1 == 0)
            {
                this._ChatBox.x = 0;
            }
            else if (param1 == 2)
            {
                this._ChatBox.x = 0;
                this._ChatBox.y = -195;
                this._showChatScale = 1;
                this.changeShowChat();
            }
            else
            {
                this._ChatBox.x = 466;
                this._ChatBox.y = 180;
                this._showChatScale = 1;
                this.changeShowChat();
            }
            return;
        }// end function

        public function set chatVisible(param1:Boolean) : void
        {
            this._ChatBox.visible = param1;
            return;
        }// end function

        public function get chatVisible() : Boolean
        {
            return this._ChatBox.visible;
        }// end function

        public function set visibleFunction(param1:int) : void
        {
            this._PostBox.visible = false;
            this._ChatBox._BtnAll.visible = false;
            this._ChatBox._BtnWorld.visible = false;
            this._ChatBox._BtnFaction.visible = false;
            this._ChatBox._BtnActivity.visible = false;
            this._ChatBox._BtnGm.visible = false;
            this._ChatBox._Btnmax.visible = false;
            this._ChatBox._Btnmin.visible = false;
            if (param1 == 0)
            {
                this._ChatBox._CheckType._Type.gotoAndStop(5);
            }
            this._typeMultiMission = param1;
            this._ChatBox._CheckType.mouseEnabled = false;
            this._ChatBox._CheckType.buttonMode = false;
            this._ChatBox._CheckType._Down.visible = false;
            return;
        }// end function

        private static function isEmptyStr(param1:String) : Boolean
        {
            var _loc_2:* = param1.length;
            var _loc_3:int = 0;
            while (_loc_3 < _loc_2)
            {
                
                if (param1.charAt(_loc_3) != " ")
                {
                }
                if (param1.charAt(_loc_3) != "　")
                {
                    return false;
                }
                _loc_3 = _loc_3 + 1;
            }
            return true;
        }// end function

    }
}
